package com.ruoyi.report.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.report.mapper.ReportRecordMapper;
import com.ruoyi.report.domain.ReportRecord;
import com.ruoyi.report.service.IReportRecordService;
import com.ruoyi.common.core.text.Convert;

/**
 * 报生成记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-17
 */
@Service
public class ReportRecordServiceImpl implements IReportRecordService 
{
    @Autowired
    private ReportRecordMapper reportRecordMapper;

    /**
     * 查询报生成记录
     * 
     * @param recordId 报生成记录主键
     * @return 报生成记录
     */
    @Override
    public ReportRecord selectReportRecordByRecordId(Long recordId)
    {
        return reportRecordMapper.selectReportRecordByRecordId(recordId);
    }

    /**
     * 查询报生成记录列表
     * 
     * @param reportRecord 报生成记录
     * @return 报生成记录
     */
    @Override
    public List<ReportRecord> selectReportRecordList(ReportRecord reportRecord)
    {
        return reportRecordMapper.selectReportRecordList(reportRecord);
    }

    /**
     * 新增报生成记录
     * 
     * @param reportRecord 报生成记录
     * @return 结果
     */
    @Override
    public int insertReportRecord(ReportRecord reportRecord)
    {
        reportRecord.setCreateTime(DateUtils.getNowDate());
        return reportRecordMapper.insertReportRecord(reportRecord);
    }

    /**
     * 修改报生成记录
     * 
     * @param reportRecord 报生成记录
     * @return 结果
     */
    @Override
    public int updateReportRecord(ReportRecord reportRecord)
    {
        return reportRecordMapper.updateReportRecord(reportRecord);
    }

    /**
     * 批量删除报生成记录
     * 
     * @param recordIds 需要删除的报生成记录主键
     * @return 结果
     */
    @Override
    public int deleteReportRecordByRecordIds(String recordIds)
    {
        return reportRecordMapper.deleteReportRecordByRecordIds(Convert.toStrArray(recordIds));
    }

    /**
     * 删除报生成记录信息
     * 
     * @param recordId 报生成记录主键
     * @return 结果
     */
    @Override
    public int deleteReportRecordByRecordId(Long recordId)
    {
        return reportRecordMapper.deleteReportRecordByRecordId(recordId);
    }
}
